Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map server to zone in pods #19770

Merged
merged 4 commits into from
Jan 30, 2020
Merged

Conversation

carbonin
Copy link
Member

This PR makes some changes to zones and servers to make them easier to manage in pods.

Automatically create a server when a zone is created and delete the servers in a zone when a zone is deleted. This also requires toning down the restrictions on deleting servers and zones.

While testing this change I found that the UI has separate logic to determine when a zone is able to be deleted. This PR also consolidates that logic with the most important change that we're allowing a zone to be deleted if it has schedules associated with it. Previously the UI prevented the delete if schedules were present, but the model didn't check for that and, in fact, has a :dependent_destroy on the relation.

Applies to ManageIQ/manageiq-pods#353

This is required to manage servers when running in containers.
Without this change a user would be stuck with a single server
and would not be able to make use of the features that zones
provide.
This will be used by the UI instead of their current, separate logic
In specs we often will create a server, which creates a zone for
us in the factory. Previously, even when we were simulating running
in pods, that would leave us with one server and one zone.

Now, the zone creation process is checking the environment for
podified and creating a server itself. This leaves us with an
extra call to MiqEnvironment::Command.is_podified and some bonus
server records.

This commit handles both of those issues.
@carbonin carbonin force-pushed the map_server_to_zone_in_pods branch from d27d378 to 3fdfb86 Compare January 27, 2020 22:22
@carbonin
Copy link
Member Author

Cross repo test for UI PR and API ManageIQ/manageiq-cross_repo-tests#58

@miq-bot
Copy link
Member

miq-bot commented Jan 27, 2020

Checked commits carbonin/manageiq@eaf2420~...3fdfb86 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
6 files checked, 1 offense detected

app/models/zone.rb

@Fryguy
Copy link
Member

Fryguy commented Jan 30, 2020

@h-kataria Do you know why the UI blocks deletion of Zones when schedules are attached?

Copy link
Member

@Fryguy Fryguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 ... just want some clarification on the zone->schedules thing in the UI

@Fryguy Fryguy merged commit 701852e into ManageIQ:master Jan 30, 2020
@Fryguy Fryguy added this to the Sprint 129 Ending Feb 3, 2020 milestone Jan 30, 2020
@carbonin
Copy link
Member Author

carbonin commented Jan 30, 2020

As far as I could tell it was added in commit 2170f15bd09d4fe69fd3759e00dcc5b87e4096c6 (2013)

@carbonin carbonin deleted the map_server_to_zone_in_pods branch January 30, 2020 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants